home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 34 / 034.d81 / magic music box (.txt) < prev    next >
Encoding:
Commodore BASIC  |  1987-01-01  |  4.9 KB  |  147 lines

  1. 100 poke53281,1:bg=53280:pokebg,14
  2. 110 print"[147]          [204][207][193][196][211][212][193][210] [208]resents:"
  3. 120 print"             [195]ommodore 64  "
  4. 130 print"            [205]agic [205]usic [194]ox "
  5. 140 print"[144]    [215]ritten by: [196]onald [202]. [197]ddington"
  6. 150 print"          (c) [195]opyright 1987"
  7. 160 forn=1to9:readh,l:nh(n)=h:nl(n)=l:next
  8. 170 data16,195,18,209,21,31,22,96,25,30,28,49,31,165,33,135,37,162
  9. 180 poke54296,10:poke54277,47:poke54278,12
  10. 190 print"[151]    [212]his program takes your melody"
  11. 200 print" and feeds it into the [205]agic [205]usic [194]ox"
  12. 210 print"  which processes it, then plays it"
  13. 220 print"    forwards, backwards, inverted,"
  14. 230 print"      [156]or backwards and inverted."
  15. 240 print"     [208]ress [[211][208][193][195][197][194][193][210]] to continue"
  16. 250 print"        or press [[198]1] for demo."
  17. 260 m$="40450568640140454566640140450568644090050866644"
  18. 270 poke198,0:wait198,1:geta$:ifa$<>" "anda$<>"[133]"then270
  19. 280 ifa$="[133]"thendemo=1:goto460
  20. 290 print"[147][144]     [206]ow, enter your series of notes
  21. 300 [153]"           using this system:"
  22. 310 [153]"1=mid-c","2=d","3=e","4=f":[153]"5=g","6=a","7=b","8=hi-c"
  23. 320 [153]"9=hi-d","0=rest"
  24. 330 [153]"valnter your melody, then press [(NULL)val(NULL)(NULL)(NULL)(NULL)]"
  25. 340 ls[178]78:[141]1340:[139]m$[178]""[167]290
  26. 350 [153]"load (NULL)ow, select the way you want it played"
  27. 360 [153]" atn> asc(NULL)(NULL)(NULL)atn(NULL)str$(NULL)":[153]" peek> peekatnlen(NULL)(NULL)atn(NULL)str$(NULL)"
  28. 370 [153]" len> right$(NULL)(NULL)val(NULL)(NULL)valstr$"
  29. 380 [153]"clr str$> peekatnlen(NULL)(NULL)atn(NULL)str$(NULL) and right$(NULL)(NULL)val(NULL)(NULL)valstr$":[153]"stop val> right$(NULL)(NULL)(NULL)(NULL) (NULL)val(NULL) (NULL)val(NULL)(NULL)str$(NULL)"
  30. 390 [153]"verify asc> val(NULL)str$ (NULL)(NULL)(NULL)chr$(NULL)atn(NULL)  ((NULL)eturn to (NULL)(NULL)atnstr$(NULL)(NULL)atn(NULL))stop"
  31. 400 [153]"verify chr$> peekatnlen(NULL)close(NULL)(NULL)closeascright$(NULL)(NULL)(NULL)close(NULL)len(NULL)valval(NULL) (for demo)"
  32. 410 [151]198,0:[146]198,1:[161]w$:[139]w$[179]"a"[176]w$[177]"g"[167]410
  33. 420 w[178][198](w$)[171]64
  34. 430 :
  35. 440 [145]w[137]460,620,770,930,290,1100
  36. 450 [139]w[178]7[167][138]
  37. 460 [143] play the melody **-forwards-**
  38. 470 [153]"load"[199](142),"    forwards   ":[151]bg,5:[141]1140
  39. 480 [153],"verify it goes in here!!poke":[153]m$:[129]d[178]1[164]500:[130]d
  40. 490 a$[178]m$:f$[178]m$:[153]"";a$;
  41. 500 p[178][195](a$)[171]1:[129]t[178]1[164][195](a$):a$[178]" "[170][200](a$,p)[170]" (NULL)"
  42. 510 [153]"";a$;:[129]d[178]1[164]34:[130]d :[129]k[178]1[164]3:[141]1230:[130]k,t
  43. 520 [151]1344[170]i,32:[141]1280
  44. 530 [129]t[178]0[164][195](m$):t$[178][201](m$,t):[153]""[166]8)"(NULL) "t$
  45. 540 [129]d[178]1[164]50:[130]:[130]:[129]d[178]1[164]500:[130]
  46. 550 [129]q[178]1[164][195](m$)
  47. 560 g[178]([198]([202](m$,q,1))[171]48)
  48. 570 [139]g[179]0[176]g[177]9[167]g[178]0
  49. 580 [151]54273,nh(g):[151]54272,nl(g):[151]54276,33
  50. 590 [129]d[178]1[164]77:[130]d:[151]54276,32:[130]q
  51. 600 [129]x[178]1[164]1234:[130]:[151]54273,0:[151]54272,0:[139]demo[167][138]
  52. 610 [137]350
  53. 620 [143] play the melody **-backwards-**
  54. 630 [153]"load"[199](142),"    backwards!  ":[151]bg,2:[141]1140
  55. 640 [153],"verify it goes in here!!poke":[153]m$:[129]d[178]1[164]500:[130]d
  56. 650 a$[178]m$:[129]t[178][195](m$)[164]1[169][171]1:b$[178]b$[170][202](m$,t,1):[130]:[153]""a$;
  57. 660 p[178][195](a$)[171]1:[129]t[178]1[164][195](a$):a$[178]" "[170][200](a$,p)[170]" (NULL)"
  58. 670 [153]"";a$;:[129]d[178]1[164]34:[130]d :[129]k[178]1[164]3:[141]1230:[130]k,t
  59. 680 [151]1344[170]i,32:[141]1280
  60. 690 [129]t[178]0[164][195](m$):t$[178][201](b$,t):[153]""[166]8)"(NULL) "t$
  61. 700 [129]d[178]1[164]50:[130]:[130]:[129]d[178]1[164]500:[130]
  62. 710 [129]q[178][195](m$)[164]1[169][171]1
  63. 720 g[178]([198]([202](m$,q,1))[171]48)
  64. 730 [139]g[179]0[176]g[177]9[167]g[178]0
  65. 740 [151]54273,nh(g):[151]54272,nl(g):[151]54276,33
  66. 750 [129]d[178]1[164]77:[130]d:[151]54276,32:[130]q
  67. 760 [129]x[178]1[164]1234:[130]:[151]54273,0:[151]54272,0:[137]350
  68. 770 [143] play the melody **-inverted-**
  69. 780 [153]"load"[199](142),"   inverted!! ":[151]bg,6:[141]1140
  70. 790 [153],"verify it goes in here!!poke":[153]m$:[129]d[178]1[164]500:[130]d
  71. 800 a$[178]m$:[129]t[178]1[164][195](m$):s[178]10[171]([197]([202](m$,t,1))):[139]s[178]10[167]i$[178]i$[170]"0":[137]807
  72. 805 i$[178]i$[170][199](s[170]48)
  73. 807 [130]
  74. 810 [153]""a$;:p[178][195](a$)[171]1:[129]t[178]1[164][195](a$):a$[178]" "[170][200](a$,p)[170]" (NULL)"
  75. 820 [153]"";a$;:[129]d[178]1[164]34:[130]d :[129]k[178]1[164]3:[141]1230:[130]k,t
  76. 830 [151]1344[170]i,32:[141]1280
  77. 840 [129]t[178]0[164][195](m$):t$[178][201](i$,t):[153]""[166]8)"(NULL) "t$
  78. 870 [129]d[178]1[164]50:[130]:[130]:[129]d[178]1[164]500:[130]
  79. 880 [129]q[178]1[164][195](m$)
  80. 890 g[178]10[171]([197]([202](m$,q,1)))
  81. 900 [151]54273,nh(g):[151]54272,nl(g):[151]54276,33
  82. 910 [129]d[178]1[164]77:[130]d:[151]54276,32:[130]q
  83. 920 [129]x[178]1[164]1234:[130]:[151]54273,0:[151]54272,0:[137]350
  84. 930 [143] play the melody **-inverted and backwards-**
  85. 940 [153]"load"[199](142),"cmdcmdcmd  inverted and backwards ":[151]bg,4:[141]1140
  86. 950 [153],"verify it goes in here!!poke":[153]m$:[129]d[178]1[164]500:[130]d
  87. 960 a$[178]m$:[129]t[178][195](m$)[164]1[169][171]1:s[178]10[171]([197]([202](m$,t,1)))
  88. 965 [139]s[178]10[167]ib$[178]ib$[170]"0":[137]972
  89. 970 ib$[178]ib$[170][199](s[170]48)
  90. 972 [130]
  91. 980 [153]""a$;:p[178][195](a$)[171]1:[129]t[178]1[164][195](a$):a$[178]" "[170][200](a$,p)[170]" (NULL)"
  92. 990 [153]"";a$;:[129]d[178]1[164]34:[130]d :[129]k[178]1[164]3:[141]1230:[130]k,t
  93. 1000 [151]1344[170]i,32:[141]1280
  94. 1010 [129]t[178]0[164][195](m$):t$[178][201](ib$,t):[153]""[166]8)"(NULL) "t$
  95. 1040 [129]d[178]1[164]50:[130]:[130]:[129]d[178]1[164]500:[130]
  96. 1050 [129]q[178][195](m$)[164]1[169][171]1
  97. 1060 g[178]10[171]([197]([202](m$,q,1)))
  98. 1070 [151]54273,nh(g):[151]54272,nl(g):[151]54276,33
  99. 1080 [129]d[178]1[164]77:[130]d:[151]54276,32:[130]q
  100. 1090 [129]x[178]1[164]1234:[130]:[151]54273,0:[151]54272,0:[137]350
  101. 1100 [143] the program ends with a siren / color / print routine
  102. 1110 [153]"               (NULL)he end! "
  103. 1120 [129]d[178]1[164]1111:[130]
  104. 1130 [137]1490
  105. 1140 [143] draw picture of magic music box
  106. 1150 [151]1384,79:[151]1423,80:[129]t[178]1385[164]1422:[151]t,119:[130]
  107. 1160 [129]t[178]55656[164]55695:[151]t,0:[130]
  108. 1170 sp[178][195](m$):[151]1344[170]sp,78:[151]1344[170]sp[170]39,32:[151]1344[170]sp[170]38,32
  109. 1180 [151]55616[170]sp,0:[151]1344[170]sp[171]1,32
  110. 1190 [151]1424,116:[151]1463,106:[151]55696,0:[151]55735,0
  111. 1200 [151]1464,76:[151]1503,122:[129]t[178]1465[164]1502:[151]t,111:[130]
  112. 1210 [129]t[178]55736[164]55775:[151]t,0:[130]
  113. 1220 [142]
  114. 1230 [143] make the magic music box process the melody
  115. 1240 g[178][187](1)[172]38:c[178][187](1)[172]16:j[178]([187](1)[172]11)[170]48:i[178]sp[171]1:n[178][187](1)[172]10
  116. 1250 [151]1425[170]g,j:[151]55697[170]g,c:[151]1344[170]i,86:[151]55616[170]i,c
  117. 1260 [151]54273,nh(n):[151]54272,nl(n):[151]54276,17:[129]d[178]1[164]3:[151]54276,16
  118. 1270 [142]
  119. 1280 [143] open the magic music box and let the melody out
  120. 1290 [129]t[178]55736[164]55775:[151]t,0:[130]:[151]1471,32:[151]1472,32
  121. 1300 [151]1511,77:[151]55783,0
  122. 1310 [153]"stopand it comes out here!"
  123. 1320 [129]d[178]1[164]1111:[130]
  124. 1330 [142]
  125. 1340 [143] input a string
  126. 1350 m$[178]""
  127. 1360 ag$[178]"to"
  128. 1370 [153]">";
  129. 1380 [153]ag$"cmd";
  130. 1390 [151]198,0:[146]198,1:[161]a$
  131. 1400 [139]a$[178][199](13)[167]1480
  132. 1410 fl[178]0:[139]a$[178]"cmd"[176]a$[178][199](20)[167]ag[178][195](m$):[139]ag[177]0[167][153]" cmdcmd cmd";:fl[178]1
  133. 1420 [139]fl[178]1[167]m$[178][200](m$,ag[171]1):[137]1380
  134. 1430 [139]a$[179]"0"[176]a$[177]"9"[167]1390
  135. 1440 [139][195](m$)[178]ls[167]1460
  136. 1450 [153]a$;:m$[178]m$[170]a$
  137. 1460 [137]1380
  138. 1470 :
  139. 1480 [139][195](m$)[178]40[167]m$[178]m$[170]"00"
  140. 1482 [139][195](m$)[178]39[167]m$[178]m$[170]"000"
  141. 1485 [142] : [143] m$=input string
  142. 1490 [143] re-connect
  143. 1500 [159]15,8,15,"r0:hello connect=hello connect":[132]15,er:[160]15
  144. 1510 [139]er[179][177]63[167][128]
  145. 1520 [159]15,8,15,"i0":[160]15
  146. 1530 [147]"hello connect",8
  147.